﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Cn.Edwon.Web.Support;
using System.Reflection;
using Cn.Cellula.Client;

namespace Cn.Cellula.Website.Test {
    public partial class Pager : PageSupport {
        protected void Page_Load(object sender, EventArgs e) {
            this.txt_Url.Text = Request.Url.GetLeftPart(UriPartial.Path);
            if (!Page.IsPostBack) {
                if (!String.IsNullOrEmpty(Request.QueryString["page"])) {
                    this.txt_CurrentPage.Text = Request.QueryString["page"];
                }
                doPager();
            }
        }

        private void doPager() {
            Int32 Total = Convert.ToInt32(this.txt_Total.Text);
            Int32 PageSize = Convert.ToInt32(this.txt_PageSize.Text);
            Int32 CurrentPage = Convert.ToInt32(this.txt_CurrentPage.Text);
            String url = this.txt_Url.Text;
            this.lab_Result.Text = ClientBiz.BuildPagerStr(Total, PageSize, url, CurrentPage);
        }

    }
}
